package br.com.iswe.gwt.crud.client;

public class PropertyNotFoundException extends RuntimeException {

	private String [] errorMessages;
	
	public  PropertyNotFoundException(){
		
	}
	
	public PropertyNotFoundException(String ... errorMessages) {
		super(getErrorMessages(errorMessages));
		this.errorMessages = errorMessages;
	}

	private static String getErrorMessages(String[] array) {
		if(array == null || array.length == 0){
			return null;
		}
		StringBuffer result = new StringBuffer(array[0]);
		for(int x = 1; x < array.length; x++){
			result.append("; ");
			result.append(array[x]);
		}
		return result.toString();
	}

	public String[] getErrorMessages() {
		return errorMessages;
	}

	
	
}
